<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="name=666">跟新</button>
        <button @click="xiaohui">销毁</button>
        {{name}}
    </div>
</body>
<script src="./vue.min.js"></script>
<script>
    let vm = new Vue({
        el:"#app",
        data:{
            name:"张三"
        },
        methods: {
            xiaohui(){
                this.$destroy()
            }
        },
        beforeCreate() {
            alert("创建前")
        },
        created() {
            alert("创建完成")
        },
        beforeMount() {
            alert("挂载前")
        },
        mounted() {
            alert("挂载后")
        },
        beforeUpdate() {
            alert("跟新前")
        },
        updated() {
            alert("更新后")
        },
        beforeDestroy() {
            alert("销毁前")
        },
        destroyed() {
            alert("销毁完成")
        },
    })
</script>
</html>